package com.cnhis.cloudhealth.clinical.hosnurse.hosstopadvice.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.cnhis.cloudhealth.commons.dao.BaseDao;
import com.cnhis.cloudhealth.commons.utils.Page;
@Repository
public class HosStopAdviceDao extends BaseDao{
	public Integer adstopviceint(Map map)throws Exception{
		String getCountSqlDef = "HosStopAdvice.nurseVerifyStopAdviceCount1";
		/*获取查询结果的记录总数*/
		int total = ((Integer)getSqlSession().selectOne(getCountSqlDef,map)).intValue();
		return total;
	}
	public Page nurseVerifyStopAdvice(Map map, int currPage, int pageSize)throws Exception{
		String getCountSqlDef = "HosStopAdvice.nurseVerifyStopAdviceCount";
		
		/*获取查询结果的记录总数*/
		int total = ((Integer)getSqlSession().selectOne(getCountSqlDef,map)).intValue();
		int  pageIndex = currPage-1;
		pageIndex = pageIndex<0?0:pageIndex;
		currPage = currPage<1?1:currPage;
		/*开始记录的位置*/
		int  startNum = 0;
		startNum = pageIndex*(pageSize<1?1:pageSize);
		map.put("currPage", startNum);
		map.put("pageSize", pageSize);
		List  list =  queryForList("HosStopAdvice.nurseVerifyStopAdvice", map);
		return new Page(list, pageSize,total,currPage);
	}
	public List checkStopAdvice(Map map)throws Exception{
		return queryForList("HosStopAdvice.checkStopAdvice", map);
	}
	public void nurseOrderStopValidate(Map map)throws Exception{
		update("HosStopAdvice.nurseOrderStopValidate", map);
	}
	public int VAFState(Map map)throws Exception{
		return (int) queryForExtObject("HosStopAdvice.VAFState", map);
	}
	public  long  getVAF01A(Map map)throws Exception{
		return (long) queryForExtObject("HosStopAdvice.getVAF01A", map);
	}
	public void insertVBG2(Map map)throws Exception{
		insert("HosStopAdvice.insertVBG2", map);
	}
	public List getVAF2(Map map)throws Exception{
		return queryForList("HosStopAdvice.getVAF2", map);
	}
	public Map sysParamValue()throws Exception{
		return (Map) queryForExtObject("HosStopAdvice.sysParamValue", null);
	}
	public Map getParams1(Map map)throws Exception{
		return (Map) queryForExtObject("HosStopAdvice.getParams1", map);
	}
	public Map getParams2(Map map)throws Exception{
		return (Map) queryForExtObject("HosStopAdvice.getParams2", map);
	}
	public Map getParams3(Map map)throws Exception{
		return (Map) queryForExtObject("HosStopAdvice.getParams3", map);
	}
	public List getStopVAF21(Map map)throws Exception{
		return queryForList("HosStopAdvice.getStopVAF21", map);
	}
	public List getStopVAF22(Map map)throws Exception{
		return queryForList("HosStopAdvice.getStopVAF22", map);
	}
	public void updateVAF2(Map map)throws Exception{
		update("HosStopAdvice.updateVAF2", map);
	}
	public Page validateLongAdvice(Map map,int currPage,int pageSize)throws Exception{
		return queryForPage("HosStopAdvice.validateLongAdvice", map,currPage,pageSize);
	}
	public Map getBCQ04B(Map map)throws Exception{
		return (Map) queryForExtObject("HosStopAdvice.getBCQ04B", map);
	}
	public String checkOut(Map map)throws Exception{
		return (String) queryForExtObject("HosStopAdvice.checkOut", map);
	}
	public int isOut(Map map)throws Exception{
		return (int) queryForExtObject("HosStopAdvice.isOut", map);
	}
	public void adviceStop(Map map)throws Exception{
		update("HosStopAdvice.adviceStop", map);
	}
	public List getTmpVAFsp(Map map)throws Exception{
		return queryForList("HosStopAdvice.getTmpVAFsp", map);
	}
	public void updateVBG1_VBZ1(Map map)throws Exception{
		update("HosStopAdvice.updateVBG1_VBZ1", map);
	}
}
